<?php defined('LFNC_PACKAGE') or die('forbidden');


/**
* MLT Web Engine
* http://www.molotsoft.ru
*
* @package MLT_WE
* @subpackage Lucky_Funcs
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: network.lfnc.php 289 2009-07-27 21:04:40Z molotsoft@gmail.com $
* @link $HeadURL: http://lucky-funcs.googlecode.com/svn/branches/version_1/funcs/network.lfnc.php $
*/


function header_powered($powered) {
	header('X-Powered-By: ' . $powered);
}

function header_expires($timestamp = 0) {
	header('Expires: ' . gmdate(DATETIME_RFC1123, $timestamp));
}

function header_cache_control($cache_control) {
	header('Cache-Control: ' . $cache_control);
}

function header_pragma($pragma) {
	header('Pragma: ' . $pragma);
}

function header_content_type($content_type = 'text/html') {
	header('Content-Type: ' . $content_type);
}

function header_location($location = '/') {
	header('Location: ' . hsc_decode($location));
}


define('IVAN_BIRTHDAY', gmmktime(2, 0, 0, 2, 24, 1985));

function header_no_cache() {
	header_cache_control('no-cache, must-revalidate');
	header_expires(IVAN_BIRTHDAY);
}

function header_no_cache_session() {
	header_expires(IVAN_BIRTHDAY);
	header_cache_control('no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
	header_pragma('no-cache');
}


function ip() {
	return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1';
}


?>